<extend name="base" />

<block name="panel">

  <div class="board">

    <div>
      <table class="table table-bordered">
            <tr>
              <td><textarea class="form-control" type="text" value="" id="welcome">{$welcome.message}</textarea></td>
              <td>{$welcome.update_time}</td>
              <td><button class="btn btn-info" id="save">save</button></td>
            </tr>
      </table>
    </div>

    <br/>
  </div>

  <script type="text/javascript">
  	$(document).ready(function(){

      var baseurl = $("#baseurl").val();


    $("#save").click(function(){
      var message = $("#welcome").val();
      $.ajax({
				type: "POST",
				url: baseurl+"Welcome/edit",
				dataType: "json",
				data:{
          message:message,
				},
				success: function(data){
					if(data){
            alert("修改成功");
          }else{
            alert("Failed");
          }
				},
			});  // ajax finished
		});		

  	});
    
  </script>

</block>


